package com.sikaryofficial.workbench.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sikaryofficial.workbench.domain.entity.OrderItem;
import com.sikaryofficial.workbench.mapper.OrderItemMapper;
import com.sikaryofficial.workbench.service.IOrderItemService;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * 预子订单Service业务层处理
 *
 * @author wuweihong
 * @date 2024-09-23
 */
@Service
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements IOrderItemService {

	    @Override
    public List<OrderItem> listByOrderHeaderIds(Collection<Long> orderHeaderIds) {
        if (orderHeaderIds == null || orderHeaderIds.isEmpty()) {
            return Collections.emptyList();
        }
        return this.lambdaQuery()
                .in(OrderItem::getOrderHeaderId, orderHeaderIds)
                .eq(OrderItem::getDeletedVersion, 0)
                .list();
    }

}
